#region license
/*
 * Copyright (C) 2007 CchenSoft.com
 * 
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License 2.1 or later, as
 * published by the Free Software Foundation. See the included License.txt
 * or http://www.gnu.org/copyleft/lesser.html for details.
 * 
 * Author: Billy Zhang
 */
#endregion

using System;

namespace CchenSoft.Workflow
{
    public class InternalWorkflowException : ApplicationException
    {
        //~ Instance fields ////////////////////////////////////////////////////////

        private Exception rootCause;

        //~ Constructors ///////////////////////////////////////////////////////////

        public InternalWorkflowException()
        {
        }

        public InternalWorkflowException(String s)
            :
            base(s)
        {
        }

        public InternalWorkflowException(String s, Exception rootCause)
            :
            base(s, rootCause)
        {
            //this.rootCause = rootCause;
        }

        public InternalWorkflowException(Exception rootCause)
            : base(rootCause.Message, rootCause)
        {
        }

        //~ Methods ////////////////////////////////////////////////////////////////

        //public Throwable getRootCause() {
        //    return rootCause;
        //}

        //public void printStackTrace() {
        //    super.printStackTrace();

        //    if (rootCause != null) {
        //        synchronized (System.err) {
        //            System.err.println("\nRoot cause:");
        //            rootCause.printStackTrace();
        //        }
        //    }
        //}

        //public void printStackTrace(PrintStream s) {
        //    super.printStackTrace(s);

        //    if (rootCause != null) {
        //        synchronized (s) {
        //            s.println("\nRoot cause:");
        //            rootCause.printStackTrace(s);
        //        }
        //    }
        //}

        //public void printStackTrace(PrintWriter s) {
        //    super.printStackTrace(s);

        //    if (rootCause != null) {
        //        synchronized (s) {
        //            s.println("\nRoot cause:");
        //            rootCause.printStackTrace(s);
        //        }
        //    }
        //}
    }
}
